package com.module;

import javax.persistence.*;

/**
 * version 1.0.0
 * 由persistence生成，注解符合JPA规范
 * @author KKW
 * @date 2017/7/7.
 */
@Entity
@Table(name = "notice", schema = "resource", catalog = "")
public class NoticeEntity {
    private int id;
    private int userId;
    private String notice;

    @Id
    @Column(name = "Id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "userID", nullable = false)
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "notice", nullable = true, length = -1)
    public String getNotice() {
        return notice;
    }

    public void setNotice(String notice) {
        this.notice = notice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        NoticeEntity that = (NoticeEntity) o;

        if (id != that.id) return false;
        if (userId != that.userId) return false;
        if (notice != null ? !notice.equals(that.notice) : that.notice != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + userId;
        result = 31 * result + (notice != null ? notice.hashCode() : 0);
        return result;
    }
}
